<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="j" uri="/struts-jquery-tags" %>
<html>
    <head>
        <title>View Person Data</title>
    </head>
    <body>
        <table bgcolor="#000000" border="0" cellpadding="3" cellspacing="1" width="98%">
    <tr bgcolor="#d0dcff">
        <td>
            <strong>Person</strong>
        </td>
        <td colspan="8" align="right">
        	<form action="" method="get">
        	<input type="text" name="skey" size="30" value="<%= request.getParameter("skey") %>" />
	        <input type="submit" value="Search" width="100" />
	        </form>
        </td>
    </tr>
    <tr bgcolor="#e4e4e4" align="center">
        <td>FistName</td>
        <td>LastName</td>
        <td>Sex</td>
        <td>BirthDate</td>
        <td>Address</td>
        <td>Status</td>
        <td colspan="3">Action</td>
    </tr>
    <s:iterator var="p" value="model">
    <tr bgcolor="#ffffff">
        <td>${p.firstName}</td>
        <td>${p.lastName}</td>
        <td>${p.male ? "Male" : "Female"}</td>
        <td>${p.birthDate}</td>
        <td>${p.address}</td>
        <td>${p.status}</td>
        <td>
        	<s:url id="detail" action="person/%{id}" />
            <a href="${detail}">Detail</a>
        </td>
        <td>
        	<s:url id="edit" action="person/%{id}/edit" />
        	<a href="${edit}">Edit</a>
        </td>
        <td>
        	<s:url id="delete" action="person/%{id}/delete" />
        	<a href="${delete}" onclick="javascript: return confirm('Delete ${p.firstName}?');">Delete</a>
        </td>
    </tr>
    </s:iterator>

    <tr bgcolor="#e4e4e4">
    	<td>
    		<s:url id="result" action="person" />
    		<a href="${result}">
    			All
		    </a>
	    </td>
        <td colspan="8" align="right">
            <strong>
            	<s:url id="new" action="person/new" />
            	<a href="${new}">Add new &gt;</a>
            </strong>
        </td>
    </tr>
        </table>
    </body>
</html>
